package com.jeethink.teach.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jeethink.teach.mapper.TeachCommonFileMapper;
import com.jeethink.teach.domain.TeachCommonFile;
import com.jeethink.teach.service.ITeachCommonFileService;
import com.jeethink.common.support.Convert;

/**
 * 通用文件 服务层实现
 * 
 * @author jeethink
 * @date 2022-09-03
 */
@Service
public class TeachCommonFileServiceImpl implements ITeachCommonFileService 
{
	@Autowired
	private TeachCommonFileMapper teachCommonFileMapper;

	/**
     * 查询通用文件信息
     * 
     * @param id 通用文件ID
     * @return 通用文件信息
     */
    @Override
	public TeachCommonFile selectTeachCommonFileById(Long id)
	{
	    return teachCommonFileMapper.selectTeachCommonFileById(id);
	}

	@Override
	public int updateDownloadTimes(TeachCommonFile teachCommonFile) {
		return teachCommonFileMapper.updateDownloadTimes(teachCommonFile);
	}

	/**
     * 查询通用文件列表
     * 
     * @param teachCommonFile 通用文件信息
     * @return 通用文件集合
     */
	@Override
	public List<TeachCommonFile> selectTeachCommonFileList(TeachCommonFile teachCommonFile)
	{
	    return teachCommonFileMapper.selectTeachCommonFileList(teachCommonFile);
	}
	
    /**
     * 新增通用文件
     * 
     * @param teachCommonFile 通用文件信息
     * @return 结果
     */
	@Override
	public int insertTeachCommonFile(TeachCommonFile teachCommonFile)
	{
	    return teachCommonFileMapper.insertTeachCommonFile(teachCommonFile);
	}
	
	/**
     * 修改通用文件
     * 
     * @param teachCommonFile 通用文件信息
     * @return 结果
     */
	@Override
	public int updateTeachCommonFile(TeachCommonFile teachCommonFile)
	{
	    return teachCommonFileMapper.updateTeachCommonFile(teachCommonFile);
	}

	/**
     * 删除通用文件对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteTeachCommonFileByIds(String ids)
	{
		return teachCommonFileMapper.deleteTeachCommonFileByIds(Convert.toStrArray(ids));
	}
	
}
